package test;

public class PC {
    private CPU cpu; // CPU对象
    private HardDisk HD; // 硬盘对象

    // 设置CPU对象
    public void setCPU(CPU cpu) {
        this.cpu = cpu;
    }

    // 设置硬盘对象
    public void setHardDisk(HardDisk HD) {
        this.HD = HD;
    }

    // 显示CPU速度和硬盘容量
    public void show() {
        System.out.println("CPU Speed: " + cpu.getSpeed() + " MHz");
        System.out.println("Hard Disk Capacity: " + HD.getAmount() + " GB");
    }
}